package definite.Guide.Book.Border;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.border.TitledBorder;

public class DoubleBorder {

	public static void main(String[] args) {
		Runnable runner = new Runnable() {

			@Override
			public void run() {
				JFrame.setDefaultLookAndFeelDecorated(true);
				JFrame frame = new JFrame("Border Examples");
				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				TitledBorder topBorder = BorderFactory
						.createTitledBorder("Top");
				topBorder.setTitlePosition(TitledBorder.ABOVE_TOP);
				TitledBorder doubleBorder = new TitledBorder(topBorder,
						"Bottom", TitledBorder.RIGHT, TitledBorder.BOTTOM);
				JButton btnDouble = new JButton();
				btnDouble.setBorder(doubleBorder);

				frame.add(btnDouble, BorderLayout.CENTER);

				frame.setLocationRelativeTo(null);
				frame.setSize(300, 200);
				frame.setVisible(true);
			}
		};

		EventQueue.invokeLater(runner);
	}
}
